//
//  CDTVPlayControlView.h
//  CDTV2
//
//  Created by Symbio on 4/8/13.
//  Copyright (c) 2013 Symbio. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>
#import <AVFoundation/AVFoundation.h>
#import "MediaProgressView.h"

@class XRVideoPlayer;

@protocol VideoPlayControlViewDelegate <NSObject>

@optional
@property (nonatomic, assign) long long startTime;
@property (nonatomic, assign) long long endTime;
@property (nonatomic, assign) long long startTimeOffset;
@property (nonatomic, assign) double currentPlayBackTime;

- (void)load;
- (void)cancelLoad;
- (void)play:(long long)selectCurrentTime;
- (void)stop;
- (void)buttonPlayTapping:(id)playControlView;
- (void)buttonFullScreen:(id)playControlView;

- (void)videoPlayControlTimeShiftProgressChanged:(NSInteger)currentShiftTime;

@end

@interface VideoPlayControlView : UIView

@property (nonatomic, assign) double currentPlayBackTime;
@property (weak,nonatomic) IBOutlet UILabel *labLeftTime;
@property (weak,nonatomic) IBOutlet UILabel *labRightTime;
@property (weak,nonatomic) IBOutlet UIButton *btnPlay;
@property (weak,nonatomic) IBOutlet UIView   *videoCommandView;
@property (weak,nonatomic) IBOutlet UIView  *progressCollectionView;
@property (weak,nonatomic) IBOutlet UILabel *titleLabel;

@property (retain ,nonatomic)  MediaProgressView *videoProgressView;
@property (strong, nonatomic) MediaProgressView *timeShiftProgressView;

@property (assign, nonatomic) BOOL isCanAirPlay;

//随手拍需要，关联的属性
@property (weak, nonatomic) IBOutlet UIButton *airPlayButton;
@property (weak, nonatomic) IBOutlet UIButton *fullScreenButton;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *RigntTimeLabelConstraint;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *processViewToRightConstraint;
@property (nonatomic, assign) BOOL isShot;
@property (nonatomic, assign) BOOL isNOFullSC;//是否全屏
@property (assign,nonatomic) BOOL isCanRefreshView;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *airPlayWidthConstraint;

@property (nonatomic,assign) id<VideoPlayControlViewDelegate> playDelegate;


- (void)setMoviePlayerController:(XRVideoPlayer *)moviePlayerController;
- (void)setIsLive:(BOOL)isLive offsetTime:(NSString *)offsetTime isProcessUrl:(BOOL)isProcessUrl andFram:(CGRect)fram isFullScreen:(BOOL)isGoFullScreen;
- (void)refreshView;
- (void)setPlayStop;
- (void)setPlayPlaying;
- (void)setPlayPaused;
- (void)reset;

@end
